#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	FILE *pf1 = fopen("data.txt", "r");
	FILE *pf2 = fopen("data_copy.txt", "w");
	if (pf1 == NULL)
	{
		perror("fopen");
		return 1;
	}
	if (pf2 == NULL)
	{
		perror("fopen");
		fclose(pf1);
		return 1;
	}
	char arr[10] = { 0 };
	fgets(arr, 6, pf1);
	fputs(arr, pf2);

	fclose(pf1); 
	pf1 = NULL;
	fclose(pf2);
	pf2 = NULL;
	return 0;
}